package com.shuan;

import javax.crypto.Cipher;
import javax.crypto.spec.SecretKeySpec;

public class Decryptor {

    private static final String ALGORITHM = "AES";
    private static final String KEY = "your-16bytes-secret-key012345678"; // 与加密密钥一致

    public static byte[] decrypt(byte[] encryptedBytes) throws Exception {
        SecretKeySpec keySpec = new SecretKeySpec(KEY.getBytes(), ALGORITHM);
        Cipher cipher = Cipher.getInstance(ALGORITHM);
        cipher.init(Cipher.DECRYPT_MODE, keySpec);
        return cipher.doFinal(encryptedBytes);
    }
}
